//
// Created by nilyang on 2021/11/28.
//

#ifndef BASIC_CLASS_INVARIANT_H
#define BASIC_CLASS_INVARIANT_H

/// class Invariant  类的不变式
struct Pos {
    int x;
    int y;

    explicit Pos(int _x = 0 , int _y = 0) :
            x(_x), y(_y) {}
};

class Snake{
private:
    int play_width;
    int play_height;
    Pos loc;
    void Invariant() const;

public:
    Snake(int _w, int _h, Pos _p);
    void TeleportAhead(Pos inc);
    Pos GetLoc();
};


void func_invariant();

#endif //BASIC_CLASS_INVARIANT_H
